app.controller("sellerController",function ($scope,$controller,sellerService) {
    $controller("commonController",{$scope:$scope});

    // 定义搜索对象，若没有，则显示空指针异常
    $scope.searchEntity={};

    //搜索
    $scope.search=function(page,rows){
        sellerService.search(page,rows,$scope.searchEntity).success(
            function(response){
                $scope.list=response.result;
                $scope.paginationConf.totalItems=response.total;//更新总记录数
            }
        );
    }

    //查看商家详情
    $scope.findOneSeller=function (sellerid) {
        sellerService.findOneSeller(sellerid).success(
            function (response) {
                $scope.entity=response;
            }
        );
    }
    $scope.status=["未审核","审核通过","审核未通过","关闭商家"];
    //修改商家状态
    $scope.updateSellerStatus=function (sellerid,status) {
        sellerService.updateSellerStatus(sellerid,status).success(
            function (response) {
                if(200 == response.code){
                    $scope.reloadList();
                }else{
                    alert("response.message");
                }
            }
        );
    }
});